home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / buildSelectObjectMM.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  7.1 KB  |  253 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  17 June 1997
  22. //
  23. //  Author:         gf
  24. //
  25. //  Description:
  26. //      This implements the SelectionObject Mask Marking Menu.
  27. //
  28.  
  29.  
  30. global proc doSelectObjectMM()
  31. {
  32.  
  33.     //    Handles
  34.     //
  35.     int $maskResult = ( `selectType -q -handle` +
  36.                         `selectType -q -ikHandle` );
  37.  
  38.     menuItem -rp "N" -l "Handles" -subMenu true;
  39.         menuItem -rp "N" -l "All Handles" 
  40.             -cb $maskResult
  41.             -c "setObjectPickMask \"Marker\" #1";
  42.         menuItem -rp "E" -l "Selection Handles" 
  43.             -cb `selectType -q -handle` 
  44.             -c "selectType -handle #1";
  45.         menuItem -rp "W" -l "IK Handles" 
  46.             -cb `selectType -q -ikHandle` 
  47.             -c "selectType -ikHandle #1";
  48.     setParent -m ..;
  49.  
  50.  
  51.     //     Joints
  52.     //
  53.     menuItem -rp "NE" -l "Joints"
  54.             -cb `selectType -q -joint` 
  55.             -c "selectType -joint #1";
  56.  
  57.  
  58.     //     Curves
  59.     //
  60.     menuItem -rp "E" -l "Curves" -subMenu true;
  61.         menuItem -rp "E" -l "All Curves" 
  62.             -cb (`selectType -q -nurbsCurve` +
  63.                 `selectType -q -cos` )
  64.             -c "setObjectPickMask \"Curve\" #1";
  65.         menuItem -rp "N" -l "NURBS Curves" 
  66.             -cb `selectType -q -nurbsCurve` 
  67.             -c "selectType -nurbsCurve #1";
  68.         menuItem -rp "S" -l "Curves On Surface" 
  69.             -cb `selectType -q -cos` 
  70.             -c "selectType -cos #1";
  71.     setParent -m ..;
  72.  
  73.  
  74.     //     Surfaces
  75.     //
  76.     menuItem -rp "SE" -l "Surfaces" -subMenu true;
  77.         menuItem -rp "SE" -l "All Surfaces" 
  78.             -cb (`selectType -q -nurbsSurface` +
  79.                 `selectType -q -polymesh` +
  80.                 `selectType -q -plane` )
  81.             -c "setObjectPickMask \"Surface\" #1";
  82.         menuItem -rp "SW" -l "NURBS Surfaces" 
  83.             -cb `selectType -q -nurbsSurface` 
  84.             -c "selectType -nurbsSurface #1";
  85.         menuItem -rp "NW" -l "Poly Surfaces" 
  86.             -cb `selectType -q -polymesh` 
  87.             -c "selectType -polymesh #1";
  88.         menuItem -rp "NE" -l "Planes" 
  89.             -cb `selectType -q -plane` 
  90.             -c "selectType -plane #1";
  91.     setParent -m ..;
  92.  
  93.  
  94.     //     Deformations
  95.     //
  96.     menuItem -rp "S" -l "Deformations" -subMenu true;
  97.         menuItem -rp "S" -l "All Deformations" 
  98.             -cb (`selectType -q -lattice` +
  99.                 `selectType -q -cluster` +
  100.                 `selectType -q -sculpt` +
  101.                 `selectType -q -nonlinear` )            
  102.             -c "setObjectPickMask \"Deformer\" #1";
  103.         menuItem -rp "W" -l "Lattices" 
  104.             -cb `selectType -q -lattice` 
  105.             -c "selectType -lattice #1";
  106.         menuItem -rp "N" -l "Clusters" 
  107.             -cb `selectType -q -cluster` 
  108.             -c "selectType -cluster #1";
  109.         menuItem -rp "E" -l "Nonlinears"
  110.             -cb `selectType -q -nonlinear` 
  111.             -c "selectType -nonlinear #1";
  112.         menuItem -rp "SW" -l "Sculpt Objects" 
  113.             -cb `selectType -q -sculpt` 
  114.             -c "selectType -sculpt #1";
  115.     setParent -m ..;
  116.  
  117.  
  118.     //     Dynamics
  119.     //
  120.     int $allDyn;
  121.     if( fluidEditLicenseFound() ) {
  122.         $allDyn = ( `selectType -q -particleShape` +
  123.                     `selectType -q -emitter` +
  124.                     `selectType -q -field` +
  125.                     `selectType -q -fluid` +
  126.                     `selectType -q -spring` +
  127.                     `selectType -q -rigidBody` +
  128.                     `selectType -q -rigidConstraint` );
  129.     } else {
  130.         $allDyn = ( `selectType -q -particleShape` +
  131.                     `selectType -q -emitter` +
  132.                     `selectType -q -field` +
  133.                     `selectType -q -spring` +
  134.                     `selectType -q -rigidBody` +
  135.                     `selectType -q -rigidConstraint` );
  136.     }
  137.              
  138.     menuItem -rp "SW" -l "Dynamics" -subMenu true;
  139.         menuItem -rp "SW" -l "All Dynamics" 
  140.             -cb $allDyn 
  141.             -c "setObjectPickMask \"Dynamic\" #1";
  142.         menuItem -rp "W" -l "Particles" 
  143.             -cb `selectType -q -particleShape` 
  144.             -c "selectType -particleShape #1";
  145.         menuItem -rp "NW" -l "Emitters" 
  146.             -cb `selectType -q -emitter` 
  147.             -c "selectType -emitter #1";
  148.         menuItem -rp "N" -l "Fields" 
  149.             -cb `selectType -q -field` 
  150.             -c "selectType -field #1";
  151.         menuItem -rp "NE" -l "Springs" 
  152.             -cb `selectType -q -spring` 
  153.             -c "selectType -spring #1";
  154.         menuItem -rp "E" -l "Rigid Bodies"
  155.             -cb `selectType -q -rigidBody` 
  156.             -c "selectType -rigidBody #1";
  157.         menuItem -rp "SE" -l "Rigid Constraints" 
  158.             -cb `selectType -q -rigidConstraint` 
  159.             -c "selectType -rigidConstraint #1";
  160.  
  161.         // Only post fluids part of MM if have license
  162.         //
  163.         if( fluidEditLicenseFound() ) {
  164.             menuItem -rp "S" -l "Fluids" 
  165.                 -cb `selectType -q -fluid` 
  166.                 -c "selectType -fluid #1";
  167.         }
  168.  
  169.     setParent -m ..;
  170.  
  171.  
  172.     //     Rendering
  173.     //
  174.     menuItem -rp "W" -l "Rendering" -subMenu true;
  175.         menuItem -rp "W" -l "All Rendering" 
  176.             -cb (`selectType -q -light` +
  177.                 `selectType -q -camera` +
  178.                 `selectType -q -texture` )
  179.             -c "setObjectPickMask \"Rendering\" #1";
  180.         menuItem -rp "N" -l "Lights" 
  181.             -cb `selectType -q -light` 
  182.             -c "selectType -light #1";
  183.         menuItem -rp "E" -l "Cameras" 
  184.             -cb `selectType -q -camera` 
  185.             -c "selectType -camera #1";
  186.         menuItem -rp "S" -l "Textures" 
  187.             -cb `selectType -q -texture` 
  188.             -c "selectType -texture #1";
  189.     setParent -m ..;
  190.  
  191.  
  192.     //     Misc.
  193.     //
  194.     menuItem -rp "NW" -l "Misc." -subMenu true;
  195.         menuItem -rp "NW" -l "All Misc." 
  196.             -cb (`selectType -q -ikEndEffector` +
  197.                 `selectType -q -locator` +
  198.                 `selectType -q -dimension` )
  199.             -c "setObjectPickMask \"Other\" #1";
  200.         menuItem -rp "NE" -l "IK End Effectors" 
  201.             -cb `selectType -q -ikEndEffector` 
  202.             -c "selectType -ikEndEffector #1";
  203.         menuItem -rp "SE" -l "Locators" 
  204.             -cb `selectType -q -locator` 
  205.             -c "selectType -locator #1";
  206.         menuItem -rp "SW" -l "Dimensions" 
  207.             -cb `selectType -q -dimension` 
  208.             -c "selectType -dimension #1";
  209.     setParent -m ..;
  210.  
  211.     //    Overflow
  212.     //
  213.  
  214.     // prevent multiple copies from getting appended, each
  215.     // time this MM is posted..
  216.     //
  217.     if( !`menuItem -exists buildSelectObjectMM_allOnItem` ) {
  218.         menuItem -l "All Objects on" -c "setObjectPickMask \"All\" 1" 
  219.             buildSelectObjectMM_allOnItem; 
  220.         menuItem -l "All Objects off" -c "setObjectPickMask \"All\" 0";
  221.         menuItem -d true;
  222.         menuItem -l "Save to shelf" -c "saveObjectMaskToShelf";
  223.         menuItem -d true;
  224.         menuItem -l "Select Components" -c "selectMode -component";
  225.         setParent -m ..;
  226.     }
  227. }
  228.  
  229.  
  230. global proc buildSelectObjectMM( )
  231. //
  232. // Creates a marking menu that allows the user
  233. // to select Object masks - reuses
  234. // the name tempMM for the name of the menu, to
  235. // ensure that there's only one of these at
  236. // any one time.
  237. {
  238.  
  239.     if( `popupMenu -exists tempMM` )
  240.     {
  241.         deleteUI tempMM;
  242.     } 
  243.  
  244.     global string $gSelect;
  245.     setToolTo $gSelect;
  246.  
  247.     selectMode -object;
  248.  
  249.     popupMenu -mm 1 -b 1 -aob 1 -p viewPanes -pmc "doSelectObjectMM" tempMM;
  250.  
  251.  
  252. }
  253.